package com.jwthhealth_pub.community.view.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.community.view.CommunityDocApplyCertificationActivity;

/**
 * 上传资格证照片
 * Created by liuzhen on 2017/12/19.
 */

public class CommunityApplyDocCertAdapter extends RecyclerView.Adapter {
    private final CommunityDocApplyCertificationActivity mActivity;

    public CommunityApplyDocCertAdapter(CommunityDocApplyCertificationActivity communityDocApplyCertificationActivity) {
        this.mActivity = communityDocApplyCertificationActivity;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ViewHolder(View.inflate(mActivity, R.layout.item_community_apply_cert, null));
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        ViewHolder vh = (ViewHolder) holder;

        if (position == getItemCount() - 1)
            vh.certPic.setText("add");

    }

    @Override
    public int getItemCount() {
        return 2;
    }

//    @Override
//    public int getItemViewType(int position) {
//        if (position == 0)
//            return CERT_TYPE.PIC.ordinal();
//        else
//            return CERT_TYPE.ADD.ordinal();
//    }

    private class ViewHolder extends RecyclerView.ViewHolder {

        Button certPic;

        public ViewHolder(View itemView) {
            super(itemView);

            certPic = itemView.findViewById(R.id.iv_applydoc_cert);
        }
    }

//    enum CERT_TYPE{
//        PIC, ADD
//    }
}
